package com.mnemonic.domain.robot;

import java.util.Random;

import com.mnemonic.domain.Game;
import com.mnemonic.domain.Grades;
import com.mnemonic.domain.RobotMineListener;
import com.mnemonic.domain.RobotPlayer;

/**
 * 机器人小度
 * 
 * @author lifeng
 * @date 2021/05/13
 */
public class XiaoduRobotPlayer extends RobotPlayer {

    private static final long serialVersionUID = 1L;

    public XiaoduRobotPlayer() {

    }

    public XiaoduRobotPlayer(String id, String name) {
        this.id = id;
        this.name = name;
        this.grade = Grades.青铜;
    }

    /**
     * 随机排雷
     */
    @Override
    public void autoMine(Game game, RobotMineListener listener) {
        Random rd = new Random();
        int x = rd.nextInt(10);
        int y = rd.nextInt(10);
        game.getMineMap()[x][y] = 0b00000100;
    }
}
